package cn.tedu.controller;

import cn.tedu.bo.TestWorkerBO;
import cn.tedu.query.TestWorkerQuery;
import cn.tedu.service.TestService;
import cn.tedu.vo.TestWorkerVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestWorkerController {
    //查询师傅信息 读操作 入参后缀 是Query

    @Autowired
    private TestService testService;

    @GetMapping("/test/worker")
    public TestWorkerVO testWorker(TestWorkerQuery testWorkerQuery){
        TestWorkerBO testWorkerBO=testService.testWoker(testWorkerQuery);
        //将BO对象转换成VO对象
        TestWorkerVO testWorkerVO = new TestWorkerVO();
        BeanUtils.copyProperties(testWorkerBO,testWorkerVO);
        return testWorkerVO;
    }

}
